3.154 \(\int \frac {\cos (c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx\)

Optimal. Leaf size=46 \[ \frac {x}{2 a}+\frac {i \cos (c+d x)}{2 d (a \cos (c+d x)+i a \sin (c+d x))} \]

[Out]

1/2*x/a+1/2*I*cos(d*x+c)/d/(a*cos(d*x+c)+I*a*sin(d*x+c))

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.069, Rules used = {3082, 8} \[ \frac {x}{2 a}+\frac {i \cos (c+d x)}{2 d (a \cos (c+d x)+i a \sin (c+d x))} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]/(a*Cos[c + d*x] + I*a*Sin[c + d*x]),x]

[Out]

x/(2*a) + ((I/2)*Cos[c + d*x])/(d*(a*Cos[c + d*x] + I*a*Sin[c + d*x]))

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3082

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symb
ol] :> -Simp[(b*(a*Cos[c + d*x] + b*Sin[c + d*x])^n)/(2*a*d*n*Cos[c + d*x]^n), x] + Dist[1/(2*a), Int[(a*Cos[c
 + d*x] + b*Sin[c + d*x])^(n + 1)/Cos[c + d*x]^(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[m + n, 0] && E
qQ[a^2 + b^2, 0] && LtQ[n, 0]

Rubi steps

\begin {align*} \int \frac {\cos (c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx &=\frac {i \cos (c+d x)}{2 d (a \cos (c+d x)+i a \sin (c+d x))}+\frac {\int 1 \, dx}{2 a}\\ &=\frac {x}{2 a}+\frac {i \cos (c+d x)}{2 d (a \cos (c+d x)+i a \sin (c+d x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.07, size = 38, normalized size = 0.83 \[ \frac {2 (c+d x)+\sin (2 (c+d x))+i \cos (2 (c+d x))}{4 a d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]/(a*Cos[c + d*x] + I*a*Sin[c + d*x]),x]

[Out]

(2*(c + d*x) + I*Cos[2*(c + d*x)] + Sin[2*(c + d*x)])/(4*a*d)

________________________________________________________________________________________

fricas [A]  time = 0.60, size = 32, normalized size = 0.70 \[ \frac {{\left (2 \, d x e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{4 \, a d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/4*(2*d*x*e^(2*I*d*x + 2*I*c) + I)*e^(-2*I*d*x - 2*I*c)/(a*d)

________________________________________________________________________________________

giac [A]  time = 2.93, size = 60, normalized size = 1.30 \[ -\frac {\frac {i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a} - \frac {i \, \log \left (-i \, \tan \left (d x + c\right ) + 1\right )}{a} + \frac {-i \, \tan \left (d x + c\right ) - 3}{a {\left (\tan \left (d x + c\right ) - i\right )}}}{4 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="giac")

[Out]

-1/4*(I*log(tan(d*x + c) - I)/a - I*log(-I*tan(d*x + c) + 1)/a + (-I*tan(d*x + c) - 3)/(a*(tan(d*x + c) - I)))
/d

________________________________________________________________________________________

maple [A]  time = 0.15, size = 59, normalized size = 1.28 \[ \frac {i \ln \left (\tan \left (d x +c \right )+i\right )}{4 a d}-\frac {i \ln \left (\tan \left (d x +c \right )-i\right )}{4 a d}+\frac {1}{2 a d \left (\tan \left (d x +c \right )-i\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x)

[Out]

1/4*I/a/d*ln(tan(d*x+c)+I)-1/4*I/a/d*ln(tan(d*x+c)-I)+1/2/a/d/(tan(d*x+c)-I)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

mupad [B]  time = 0.71, size = 39, normalized size = 0.85 \[ \frac {x}{2\,a}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,d\,{\left (1+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}\right )}^2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)/(a*cos(c + d*x) + a*sin(c + d*x)*1i),x)

[Out]

x/(2*a) + tan(c/2 + (d*x)/2)/(a*d*(tan(c/2 + (d*x)/2)*1i + 1)^2)

________________________________________________________________________________________

sympy [A]  time = 0.21, size = 61, normalized size = 1.33 \[ \begin {cases} \frac {i e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text {for}\: 4 a d e^{2 i c} \neq 0 \\x \left (\frac {\left (e^{2 i c} + 1\right ) e^{- 2 i c}}{2 a} - \frac {1}{2 a}\right ) & \text {otherwise} \end {cases} + \frac {x}{2 a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x)

[Out]

Piecewise((I*exp(-2*I*c)*exp(-2*I*d*x)/(4*a*d), Ne(4*a*d*exp(2*I*c), 0)), (x*((exp(2*I*c) + 1)*exp(-2*I*c)/(2*
a) - 1/(2*a)), True)) + x/(2*a)

________________________________________________________________________________________